package ucm.controller;

import java.security.NoSuchAlgorithmException;
import javax.swing.JOptionPane;
import ucm.module.UC_CreInfoM;

public class UC_CreInfoC {
    private String start_city = null;
    private String end_city = null;
    private String start_time = null;
    private String end_time = null;
    private String ticketcount = null;
    private String price = null;



    public UC_CreInfoC(String start_city,String end_city,String start_time,String end_time,String ticketcount,String price) throws NoSuchAlgorithmException {
        this.start_city = start_city;
        this.end_city = end_city;
        this.start_time = start_time;
        this.end_time = end_time;
        this.ticketcount = ticketcount;
        this.price = price;
    }


    
    public void run()
    {
        if (start_city.equals("") &&
                end_city.equals("") &&
                start_time.equals("") &&
                end_time.equals("") &&
                ticketcount.equals("") &&
                price.equals(""))
        {
            JOptionPane.showMessageDialog(null, "Create air information is incomplete, please fill out the full!");           
        }
        else {
            UC_CreInfoM uc_cim = new UC_CreInfoM();
            uc_cim.create(start_city,end_city,start_time,end_time,ticketcount,price);
        }
    }
}
